<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /*
            1.兄弟关系,两个盒子垂直外边距与水平外边距的问题
                -垂直方向，外边距取最大值
                -水平方向，外边距进行合并处理
        */
        div {
            width: 200px;
            height: 200px;
        }

        .deew {
            background-color: greenyellow;
            margin-bottom: 100px;
        }

        .wewer {
            background-color: hotpink;
            margin-top: 50px;
            margin-bottom: 30px;
        }

        .box1 {
            background-color: red;
            float: left;
            margin-right: 100px;

        }

        .box2 {
            background-color: sienna;
            float: left;
            margin-left: 50px;
        }
    </style>
</head>

<body>
    <div class="deew"></div>
    <div class="wewer"></div>

    <div class="box1"></div>
    <div class="box2"></div>
</body>

</html>